package com.atstudying.mall.product.service;

import com.atstudying.common.utils.PageUtils;
import com.atstudying.common.valid.AddGroup;
import com.atstudying.common.valid.UpdateGroup;
import com.atstudying.mall.product.entity.BrandEntity;
import com.atstudying.mall.product.entity.CategoryBrandRelationEntity;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.List;
import java.util.Map;

/**
 * 品牌分类关联
 *
 * @author zlj
 * @email 2908434305@qq.com
 * @date 2020-10-04 22:40:50
 */
public interface CategoryBrandRelationService extends IService<CategoryBrandRelationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveDetail(CategoryBrandRelationEntity categoryBrandRelation);

    void updateBrand(@NotBlank(message = "品牌名不可以为空", groups = {UpdateGroup.class, AddGroup.class}) String name, @NotNull(message = "修改必须指定品牌id", groups = {UpdateGroup.class}) @Null(message = "新增不可以指定id", groups = {AddGroup.class}) Long brandId);

    void updateCategory(Long catId, String name);

    List<BrandEntity> getBrandsByCatId(Long catId);
}

